<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name',100)->index()->comment('账号');
            $table->string('password')->nullable()->comment('密码');
            $table->string('openid')->nullable()->comment('用户微信id');
            $table->string('unionid')->unique()->nullable()->comment('微信识别标识');
            $table->boolean('is_super')->default(false)->comment('是否超级管理员 true-是 false-不是');
            $table->dateTime('birthday')->nullable()->comment('生日');
            $table->string('avatar')->nullable()->default('')->comment('用户头像');
            $table->tinyInteger('gender')->nullable()->default(0)->comment('性别');
            $table->tinyInteger('status')->nullable()->default(0)->comment('状态');
            $table->text('signature')->nullable()->comment('个性签名');
            $table->timestamps();

            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_users');
    }
}
